import java.util.Scanner;
public class Demo {
    public static void main(String[] args) {
        String name, ID; //姓名;学号
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入姓名和学号：");
        name = scanner.nextLine(); //从控制台输入姓名
        ID = scanner.nextLine();  //从控制台输入学号
        System.out.println("逆序结果：");
        //获取字符串长度，逆序输出串中的字符
        for (int i = name.length() - 1; i >= 0; i--)
            System.out.print(name.charAt(i)); //charAt获取字符串中的字符
        System.out.println(); //输出换行
        for (int i = ID.length() - 1; i >= 0; i--)
            System.out.print(ID.charAt(i));
        System.out.println(); //输出换行
        scanner.close();
    }
}
